package com.UI
{
	import com.*;
	import com.Engine.*;
	import com.Home.*;
	import com.Packet.*;
	
	import flash.display.*;
	import flash.events.*;
	import flash.external.*;
	import flash.filters.*;
	import flash.geom.*;
	import flash.net.*;
	import flash.system.*;
	import flash.text.*;
	import flash.ui.*;
	import flash.utils.*;
	
	import gs.*;
	import gs.easing.*;
	import gs.events.TweenEvent;
	
	//import mx.containers.Panel;
	
	import org.aswing.*;
	import org.aswing.border.*;
	import org.aswing.border.EmptyBorder;
	import org.aswing.colorchooser.*;
	import org.aswing.dnd.*;
	import org.aswing.event.*;
	import org.aswing.ext.*;
	import org.aswing.geom.*;
	import org.aswing.plaf.*;
	import org.aswing.skinbuilder.SkinProgressBarBackground;
	import org.aswing.skinbuilder.SkinProgressBarForeground;
	
	public class PanelMainHelp extends JPanel
	{
		
		//members define
		public var panelNorth:JPanel;
		private var panelChar:JPanel;
		private var labelCharName:JLabel;
		private var labelLevelChar:JLabel;
		private var labelMoney:JLabel;
		private var labelIngot:JLabel;
		private var panelHead:JPanel;
		private var btn_voice:JButton;
		private var btn_vip:JButton;
		private var btn_recharge:JButton;
		private var btn_add:JButton;
		private var panelHP:PanelProgress;
		private var panelStamina:PanelProgress;
		private var panelPet:JPanel;
		private var panelHeadP:JPanel;
		private var panelHPP:PanelProgress;
		private var panelEXPP:PanelProgress;
		private var labelLevelP:JLabel;
		private var labelCharNameP:JLabel;
		private var panelNorthBigButtons:JPanel;
		private var btn_copy:JButton;
		private var panelMap:JPanel;
		private var panelMapFrame:JPanel;
		public var labelButtonLine:JLabelButton;
		public var labelMapName:JLabel;
		public var labelMapPosition:JLabel;
		private var panelNorthButtons:JPanel;
		private var btn_world:JButton;
		public var btn_hide:JButton;
		public var btn_battle:JButton;
		private var btn_rank:JButton;
		private var btn_shop:JButton;
		private var btn_trend:JButton;
		private var panelSmallMap:PanelSmallMap;
		public var panelSouth:JPanel;
		private var panelSouthChats:JPanel;
		private var btn_channel:JButton;
		private var txt_field:JTextField;
		private var btn_motion:JButton;
		private var btn_send:JButton;
		private var panelSouthBottom:JPanel;
		public var panelSouthButtons:JPanel;
		private var btn_char:JButton;
		public var btn_bag:JButton;
		private var btn_slave:JButton;
		private var btn_lover:JButton;
		private var btn_pet:JButton;
		private var btn_team:JButton;
		private var btn_friend:JButton;
		private var btn_faction:JButton;
		private var btn_home:JButton;
		private var panelEXP:PanelProgress;
		public var panelEast:JPanel;
		private var panelTask:JPanel;
		private var panelTaskTop:JPanel;
		private var btn_accepted_task:JToggleButton;
		private var btn_acceptable_task:JToggleButton;
		private var btn_details:JButton;
		private var btn_task_list:JButton;
		private var panelTasks:JPanel;
		public var panelWest:JPanel;
		public var panelCenter:JPanel;
		
		/**
		 * MyPaneMainHelp Constructor
		 */
		public function PanelMainHelp(){
			//component creation
			setFont(new ASFont("Tahoma", 10, false, false, false, false));
			setSize(new IntDimension(1200, 600));
			setPreferredSize(new IntDimension(1200, 600));
			var layout0:BorderLayout = new BorderLayout();
			layout0.setHgap(0);
			layout0.setVgap(0);
			setLayout(layout0);
			
			panelNorth = new JPanel();
			panelNorth.setLocation(new IntPoint(0, 0));
			panelNorth.setSize(new IntDimension(1200, 150));
			panelNorth.setPreferredSize(new IntDimension(800, 150));
			panelNorth.setConstraints("North");
			panelNorth.setBorder(null);
			var layout1:EmptyLayout = new EmptyLayout();
			panelNorth.setLayout(layout1);
			
			panelChar = new JPanel();
			panelChar.setLocation(new IntPoint(0, 0));
			panelChar.setSize(new IntDimension(206, 93));
			panelChar.setPreferredSize(new IntDimension(206, 93));
			var layout2:EmptyLayout = new EmptyLayout();
			panelChar.setLayout(layout2);
			
			labelCharName = new JLabel();
			labelCharName.setLocation(new IntPoint(75, 24));
			labelCharName.setSize(new IntDimension(85, 16));
			labelCharName.setPreferredSize(new IntDimension(85, 16));
			labelCharName.setText("label");
			labelCharName.setHorizontalAlignment(AsWingConstants.CENTER);
			
			labelLevelChar = new JLabel();
			labelLevelChar.setFont(new ASFont("Tahoma", 12, false, false, false, false));
			labelLevelChar.setLocation(new IntPoint(60, 5));
			labelLevelChar.setSize(new IntDimension(30, 20));
			labelLevelChar.setPreferredSize(new IntDimension(30, 20));
			labelLevelChar.setText("123");
			labelLevelChar.setHorizontalAlignment(AsWingConstants.CENTER);
			labelLevelChar.setVerticalAlignment(AsWingConstants.CENTER);
			labelLevelChar.setHorizontalTextPosition(AsWingConstants.CENTER);
			labelLevelChar.setVerticalTextPosition(AsWingConstants.CENTER);
			
			labelMoney = new JLabel();
			labelMoney.setLocation(new IntPoint(153, 68));
			labelMoney.setSize(new IntDimension(49, 16));
			labelMoney.setPreferredSize(new IntDimension(49, 16));
			labelMoney.setText("123456");
			labelMoney.setHorizontalAlignment(AsWingConstants.CENTER);
			
			labelIngot = new JLabel();
			labelIngot.setLocation(new IntPoint(84, 68));
			labelIngot.setSize(new IntDimension(50, 16));
			labelIngot.setPreferredSize(new IntDimension(50, 16));
			labelIngot.setText("23654");
			
			panelHead = new JPanel();
			panelHead.setLocation(new IntPoint(8, 1));
			panelHead.setSize(new IntDimension(70, 70));
			panelHead.setPreferredSize(new IntDimension(70, 70));
			
			btn_voice = new JButton();
			btn_voice.setLocation(new IntPoint(0, 43));
			btn_voice.setSize(new IntDimension(21, 21));
			btn_voice.setPreferredSize(new IntDimension(21, 21));
			btn_voice.setText("label");
			
			btn_vip = new JButton();
			btn_vip.setLocation(new IntPoint(8, 58));
			btn_vip.setSize(new IntDimension(25, 25));
			btn_vip.setPreferredSize(new IntDimension(25, 25));
			btn_vip.setText("label");
			
			btn_recharge = new JButton();
			btn_recharge.setLocation(new IntPoint(29, 69));
			btn_recharge.setSize(new IntDimension(34, 24));
			btn_recharge.setPreferredSize(new IntDimension(34, 24));
			btn_recharge.setText("label");
			
			btn_add = new JButton();
			btn_add.setLocation(new IntPoint(141, 50));
			btn_add.setSize(new IntDimension(18, 17));
			btn_add.setPreferredSize(new IntDimension(18, 17));
			btn_add.setText("label");
			
			panelHP = new PanelProgress();
			panelHP.setLocation(new IntPoint(75, 40));
			panelHP.setSize(new IntDimension(70, 15));
			panelHP.setPreferredSize(new IntDimension(70, 15));
			
			panelStamina = new PanelProgress();
			panelStamina.setLocation(new IntPoint(73, 52));
			panelStamina.setSize(new IntDimension(70, 15));
			panelStamina.setPreferredSize(new IntDimension(70, 15));
			
			panelPet = new JPanel();
			panelPet.setLocation(new IntPoint(206, 0));
			panelPet.setSize(new IntDimension(142, 68));
			panelPet.setPreferredSize(new IntDimension(142, 68));
			var layout3:EmptyLayout = new EmptyLayout();
			panelPet.setLayout(layout3);
			
			panelHeadP = new JPanel();
			panelHeadP.setLocation(new IntPoint(-10, 0));
			panelHeadP.setSize(new IntDimension(70, 70));
			panelHeadP.setPreferredSize(new IntDimension(70, 70));
			
			panelHPP = new PanelProgress();
			panelHPP.setLocation(new IntPoint(58, 37));
			panelHPP.setSize(new IntDimension(70, 15));
			panelHPP.setPreferredSize(new IntDimension(70, 15));
			
			panelEXPP = new PanelProgress();
			panelEXPP.setLocation(new IntPoint(55, 49));
			panelEXPP.setSize(new IntDimension(70, 15));
			panelEXPP.setPreferredSize(new IntDimension(70, 15));
			
			labelLevelP = new JLabel();
			labelLevelP.setFont(new ASFont("Tahoma", 12, false, false, false, false));
			labelLevelP.setLocation(new IntPoint(42, 3));
			labelLevelP.setSize(new IntDimension(30, 20));
			labelLevelP.setPreferredSize(new IntDimension(30, 20));
			labelLevelP.setText("123");
			labelLevelP.setHorizontalAlignment(AsWingConstants.CENTER);
			labelLevelP.setVerticalAlignment(AsWingConstants.CENTER);
			labelLevelP.setHorizontalTextPosition(AsWingConstants.CENTER);
			labelLevelP.setVerticalTextPosition(AsWingConstants.CENTER);
			
			labelCharNameP = new JLabel();
			labelCharNameP.setLocation(new IntPoint(60, 22));
			labelCharNameP.setSize(new IntDimension(84, 16));
			labelCharNameP.setPreferredSize(new IntDimension(84, 16));
			labelCharNameP.setText("label");
			
			panelNorthBigButtons = new JPanel();
			panelNorthBigButtons.setLocation(new IntPoint(735, 0));
			panelNorthBigButtons.setSize(new IntDimension(265, 67));
			panelNorthBigButtons.setPreferredSize(new IntDimension(265, 67));
			var layout4:FlowWrapLayout = new FlowWrapLayout();
			layout4.setPreferWidth(200);
			layout4.setAlignment(AsWingConstants.RIGHT);
			layout4.setHgap(0);
			layout4.setVgap(0);
			layout4.setMargin(false);
			panelNorthBigButtons.setLayout(layout4);
			
			btn_copy = new JButton();
			btn_copy.setLocation(new IntPoint(212, 0));
			btn_copy.setSize(new IntDimension(53, 67));
			btn_copy.setPreferredSize(new IntDimension(53, 67));
			btn_copy.setText("label");
			
			panelMap = new JPanel();
			panelMap.setLocation(new IntPoint(1000, 0));
			panelMap.setSize(new IntDimension(200, 150));
			panelMap.setPreferredSize(new IntDimension(200, 150));
			var layout5:EmptyLayout = new EmptyLayout();
			panelMap.setLayout(layout5);
			
			panelMapFrame = new JPanel();
			panelMapFrame.setLocation(new IntPoint(0, 0));
			panelMapFrame.setSize(new IntDimension(200, 30));
			panelMapFrame.setPreferredSize(new IntDimension(200, 30));
			var layout6:FlowWrapLayout = new FlowWrapLayout();
			layout6.setPreferWidth(200);
			layout6.setAlignment(AsWingConstants.CENTER);
			layout6.setHgap(3);
			layout6.setVgap(0);
			panelMapFrame.setLayout(layout6);
			
			labelButtonLine = new JLabelButton();
			labelButtonLine.setLocation(new IntPoint(55, 0));
			labelButtonLine.setSize(new IntDimension(28, 30));
			labelButtonLine.setPreferredSize(new IntDimension(28, 30));
			labelButtonLine.setText("label");
			
			labelMapName = new JLabel();
			labelMapName.setFont(new ASFont("Tahoma", 14, false, false, false, false));
			labelMapName.setLocation(new IntPoint(68, 0));
			labelMapName.setSize(new IntDimension(72, 30));
			labelMapName.setPreferredSize(new IntDimension(72, 30));
			labelMapName.setText("中华人民共和");
			labelMapName.setHorizontalAlignment(AsWingConstants.CENTER);
			
			labelMapPosition = new JLabel();
			labelMapPosition.setLocation(new IntPoint(130, 0));
			labelMapPosition.setSize(new IntDimension(60, 30));
			labelMapPosition.setPreferredSize(new IntDimension(60, 30));
			labelMapPosition.setText("(1232,123)");
			labelMapPosition.setHorizontalAlignment(AsWingConstants.LEFT);
			
			panelNorthButtons = new JPanel();
			panelNorthButtons.setLocation(new IntPoint(0, 103));
			panelNorthButtons.setSize(new IntDimension(200, 47));
			panelNorthButtons.setPreferredSize(new IntDimension(200, 47));
			var layout7:GridLayout = new GridLayout();
			layout7.setRows(1);
			layout7.setColumns(6);
			layout7.setHgap(0);
			layout7.setVgap(0);
			panelNorthButtons.setLayout(layout7);
			
			btn_world = new JButton();
			btn_world.setLocation(new IntPoint(0, 0));
			btn_world.setSize(new IntDimension(33, 47));
			btn_world.setText("label");
			
			btn_hide = new JButton();
			btn_hide.setSize(new IntDimension(200, 47));
			btn_hide.setText("label");
			
			btn_battle = new JButton();
			btn_battle.setLocation(new IntPoint(100, 0));
			btn_battle.setSize(new IntDimension(100, 47));
			btn_battle.setText("label");
			
			btn_rank = new JButton();
			btn_rank.setLocation(new IntPoint(132, 0));
			btn_rank.setSize(new IntDimension(66, 47));
			btn_rank.setText("label");
			
			btn_shop = new JButton();
			btn_shop.setLocation(new IntPoint(150, 0));
			btn_shop.setSize(new IntDimension(50, 47));
			btn_shop.setText("label");
			
			btn_trend = new JButton();
			btn_trend.setLocation(new IntPoint(160, 0));
			btn_trend.setSize(new IntDimension(33, 47));
			btn_trend.setText("label");
			
			panelSmallMap = new PanelSmallMap();
			panelSmallMap.setLocation(new IntPoint(10, 30));
			panelSmallMap.setSize(new IntDimension(180, 73));
			panelSmallMap.setPreferredSize(new IntDimension(180, 73));
			
			panelSouth = new JPanel();
			panelSouth.setEnabled(false);
			panelSouth.setLocation(new IntPoint(0, 522));
			panelSouth.setSize(new IntDimension(1200, 78));
			panelSouth.setPreferredSize(new IntDimension(1200, 78));
			panelSouth.setConstraints("South");
			var layout8:EmptyLayout = new EmptyLayout();
			panelSouth.setLayout(layout8);
			
			panelSouthChats = new JPanel();
			panelSouthChats.setLocation(new IntPoint(0, 49));
			panelSouthChats.setSize(new IntDimension(326, 27));
			panelSouthChats.setPreferredSize(new IntDimension(326, 27));
			var layout9:EmptyLayout = new EmptyLayout();
			panelSouthChats.setLayout(layout9);
			
			btn_channel = new JButton();
			btn_channel.setLocation(new IntPoint(5, 4));
			btn_channel.setSize(new IntDimension(39, 18));
			btn_channel.setPreferredSize(new IntDimension(39, 18));
			btn_channel.setText("世界");
			
			txt_field = new JTextField();
			txt_field.setLocation(new IntPoint(47, 3));
			txt_field.setSize(new IntDimension(207, 24));
			txt_field.setPreferredSize(new IntDimension(207, 24));
			
			btn_motion = new JButton();
			btn_motion.setLocation(new IntPoint(256, 4));
			btn_motion.setSize(new IntDimension(19, 19));
			btn_motion.setPreferredSize(new IntDimension(19, 19));
			btn_motion.setText("label");
			
			btn_send = new JButton();
			btn_send.setLocation(new IntPoint(279, 4));
			btn_send.setSize(new IntDimension(39, 18));
			btn_send.setPreferredSize(new IntDimension(39, 18));
			btn_send.setText("label");
			
			panelSouthBottom = new JPanel();
			panelSouthBottom.setLocation(new IntPoint(726, 42));
			panelSouthBottom.setSize(new IntDimension(474, 27));
			panelSouthBottom.setPreferredSize(new IntDimension(474, 27));
			var layout10:FlowWrapLayout = new FlowWrapLayout();
			layout10.setPreferWidth(200);
			layout10.setAlignment(AsWingConstants.RIGHT);
			layout10.setHgap(0);
			layout10.setVgap(0);
			panelSouthBottom.setLayout(layout10);
			
			panelSouthButtons = new JPanel();
			panelSouthButtons.setLocation(new IntPoint(766, 18));
			panelSouthButtons.setSize(new IntDimension(360, 51));
			panelSouthButtons.setPreferredSize(new IntDimension(360, 51));
			var layout11:GridLayout = new GridLayout();
			layout11.setRows(1);
			layout11.setColumns(8);
			layout11.setHgap(0);
			layout11.setVgap(0);
			panelSouthButtons.setLayout(layout11);
			
			btn_char = new JButton();
			btn_char.setLocation(new IntPoint(211, 0));
			btn_char.setSize(new IntDimension(50, 51));
			btn_char.setPreferredSize(new IntDimension(50, 51));
			btn_char.setText("人物");
			
			btn_bag = new JButton();
			btn_bag.setLocation(new IntPoint(244, 0));
			btn_bag.setSize(new IntDimension(50, 51));
			btn_bag.setPreferredSize(new IntDimension(50, 51));
			btn_bag.setText("背包");
			
			btn_slave = new JButton();
			btn_slave.setLocation(new IntPoint(277, 0));
			btn_slave.setSize(new IntDimension(50, 51));
			btn_slave.setPreferredSize(new IntDimension(50, 51));
			btn_slave.setText("奴隶");
			
			btn_lover = new JButton();
			btn_lover.setLocation(new IntPoint(310, 0));
			btn_lover.setSize(new IntDimension(50, 51));
			btn_lover.setPreferredSize(new IntDimension(50, 51));
			btn_lover.setText("情人");
			
			btn_pet = new JButton();
			btn_pet.setLocation(new IntPoint(343, 0));
			btn_pet.setSize(new IntDimension(50, 51));
			btn_pet.setPreferredSize(new IntDimension(50, 51));
			btn_pet.setText("宠物");
			
			btn_team = new JButton();
			btn_team.setLocation(new IntPoint(376, 0));
			btn_team.setSize(new IntDimension(50, 51));
			btn_team.setPreferredSize(new IntDimension(50, 51));
			btn_team.setText("队伍");
			
			btn_friend = new JButton();
			btn_friend.setLocation(new IntPoint(409, 0));
			btn_friend.setSize(new IntDimension(50, 51));
			btn_friend.setPreferredSize(new IntDimension(50, 51));
			btn_friend.setText("好友");
			
			btn_faction = new JButton();
			btn_faction.setLocation(new IntPoint(442, 0));
			btn_faction.setSize(new IntDimension(50, 51));
			btn_faction.setPreferredSize(new IntDimension(50, 51));
			btn_faction.setText("帮派");
			
			btn_home = new JButton();
			btn_home.setLocation(new IntPoint(1126, 0));
			btn_home.setSize(new IntDimension(74, 69));
			btn_home.setPreferredSize(new IntDimension(74, 69));
			btn_home.setText("幻境");
			
			panelEXP = new PanelProgress();
			panelEXP.setLocation(new IntPoint(775, 67));
			panelEXP.setSize(new IntDimension(425, 9));
			panelEXP.setPreferredSize(new IntDimension(425, 9));
			
			panelEast = new JPanel();
			panelEast.setEnabled(false);
			panelEast.setLocation(new IntPoint(600, 98));
			panelEast.setSize(new IntDimension(200, 475));
			panelEast.setPreferredSize(new IntDimension(200, 475));
			panelEast.setConstraints("East");
			var layout12:FlowLayout = new FlowLayout();
			layout12.setAlignment(AsWingConstants.CENTER);
			layout12.setHgap(0);
			layout12.setVgap(0);
			panelEast.setLayout(layout12);
			
			panelTask = new JPanel();
			panelTask.setLocation(new IntPoint(10, 0));
			panelTask.setSize(new IntDimension(190, 373));
			panelTask.setPreferredSize(new IntDimension(190, 373));
			var layout13:FlowWrapLayout = new FlowWrapLayout();
			layout13.setPreferWidth(200);
			layout13.setAlignment(AsWingConstants.LEFT);
			layout13.setHgap(0);
			layout13.setVgap(0);
			layout13.setMargin(false);
			panelTask.setLayout(layout13);
			
			panelTaskTop = new JPanel();
			panelTaskTop.setSize(new IntDimension(190, 23));
			panelTaskTop.setConstraints("North");
			var layout14:SoftBoxLayout = new SoftBoxLayout();
			layout14.setAxis(AsWingConstants.HORIZONTAL);
			layout14.setAlign(AsWingConstants.LEFT);
			layout14.setGap(0);
			panelTaskTop.setLayout(layout14);
			
			btn_accepted_task = new JToggleButton();
			btn_accepted_task.setLocation(new IntPoint(0, 0));
			btn_accepted_task.setSize(new IntDimension(68, 22));
			btn_accepted_task.setPreferredSize(new IntDimension(65, 22));
			btn_accepted_task.setText("已接任务");
			
			btn_acceptable_task = new JToggleButton();
			btn_acceptable_task.setLocation(new IntPoint(69, 0));
			btn_acceptable_task.setSize(new IntDimension(68, 23));
			btn_acceptable_task.setPreferredSize(new IntDimension(65, 22));
			btn_acceptable_task.setText("可接任务");
			
			btn_details = new JButton();
			btn_details.setLocation(new IntPoint(136, 0));
			btn_details.setSize(new IntDimension(39, 23));
			btn_details.setPreferredSize(new IntDimension(36, 22));
			btn_details.setText("详情");
			
			btn_task_list = new JButton();
			btn_task_list.setLocation(new IntPoint(173, 0));
			btn_task_list.setSize(new IntDimension(20, 22));
			btn_task_list.setPreferredSize(new IntDimension(20, 22));
			btn_task_list.setText("label");
			
			panelTasks = new JPanel();
			panelTasks.setLocation(new IntPoint(0, 33));
			panelTasks.setSize(new IntDimension(190, 0));
			panelTasks.setConstraints("Center");
			var layout15:FlowWrapLayout = new FlowWrapLayout();
			layout15.setPreferWidth(200);
			layout15.setAlignment(AsWingConstants.LEFT);
			layout15.setHgap(0);
			layout15.setVgap(0);
			layout15.setMargin(false);
			panelTasks.setLayout(layout15);
			
			panelWest = new JPanel();
			panelWest.setEnabled(false);
			panelWest.setLocation(new IntPoint(0, 75));
			panelWest.setSize(new IntDimension(0, 433));
			panelWest.setConstraints("West");
			var layout16:SoftBoxLayout = new SoftBoxLayout();
			layout16.setAxis(AsWingConstants.VERTICAL);
			layout16.setAlign(AsWingConstants.TOP);
			layout16.setGap(3);
			panelWest.setLayout(layout16);
			
			panelCenter = new JPanel();
			panelCenter.setEnabled(false);
			panelCenter.setLocation(new IntPoint(96, 92));
			panelCenter.setSize(new IntDimension(420, 475));
			panelCenter.setConstraints("Center");
			
			//component layoution
			append(panelNorth);
			append(panelSouth);
			append(panelEast);
			append(panelWest);
			append(panelCenter);
			
			panelNorth.append(panelChar);
			panelNorth.append(panelPet);
			panelNorth.append(panelNorthBigButtons);
			panelNorth.append(panelMap);
			
			panelChar.append(labelCharName);
			panelChar.append(labelLevelChar);
			panelChar.append(labelMoney);
			panelChar.append(labelIngot);
			panelChar.append(panelHead);
			panelChar.append(btn_voice);
			panelChar.append(btn_vip);
			panelChar.append(btn_recharge);
			panelChar.append(btn_add);
			panelChar.append(panelHP);
			panelChar.append(panelStamina);
			
			panelPet.append(panelHeadP);
			panelPet.append(panelHPP);
			panelPet.append(panelEXPP);
			panelPet.append(labelLevelP);
			panelPet.append(labelCharNameP);
			
			panelNorthBigButtons.append(btn_copy);
			
			panelMap.append(panelMapFrame);
			panelMap.append(panelNorthButtons);
			panelMap.append(panelSmallMap);
			
			panelMapFrame.append(labelButtonLine);
			panelMapFrame.append(labelMapName);
			panelMapFrame.append(labelMapPosition);
			
			panelNorthButtons.append(btn_world);
			panelNorthButtons.append(btn_hide);
			panelNorthButtons.append(btn_battle);
			panelNorthButtons.append(btn_rank);
			panelNorthButtons.append(btn_shop);
			panelNorthButtons.append(btn_trend);
			
			panelSouth.append(panelSouthChats);
			panelSouth.append(panelSouthBottom);
			panelSouth.append(panelSouthButtons);
			panelSouth.append(btn_home);
			panelSouth.append(panelEXP);
			
			panelSouthChats.append(btn_channel);
			panelSouthChats.append(txt_field);
			panelSouthChats.append(btn_motion);
			panelSouthChats.append(btn_send);
			
			panelSouthButtons.append(btn_char);
			panelSouthButtons.append(btn_bag);
			panelSouthButtons.append(btn_slave);
			panelSouthButtons.append(btn_lover);
			panelSouthButtons.append(btn_pet);
			panelSouthButtons.append(btn_team);
			panelSouthButtons.append(btn_friend);
			panelSouthButtons.append(btn_faction);
			
			panelEast.append(panelTask);
			
			panelTask.append(panelTaskTop);
			panelTask.append(panelTasks);
			
			panelTaskTop.append(btn_accepted_task);
			panelTaskTop.append(btn_acceptable_task);
			panelTaskTop.append(btn_details);
			panelTaskTop.append(btn_task_list);
			//component creation
			
			/*FrameChat.getInstance().setLocation(new IntPoint(0, 373));
			FrameChat.getInstance().pack();
			FrameChat.getInstance().paintImmediately();
			addChild(FrameChat.getInstance());
			FrameChat.getInstance().pack();
			FrameChat.getInstance().paintImmediately();
			pack();
			paintImmediately();*/

			panelHP.setResource("img_hp");
			panelStamina.setResource("img_stamina");
			panelHPP.setResource("img_hp");
			panelEXPP.setResource("img_exp");
			panelEXP.setBackgroundDecorator(new AssetBackground(Client.getUIElement("img_exp_main_bg") as DisplayObject));
			panelEXP.setResource("img_exp_main");
			//panelEXP.setTextVisible(true);
			btn_motion.setClipMasked(false);
			
			labelMapName.setText("测试地图名");
			labelMapName.setForeground(new ASColor(0xFFFFFF, 1));
			labelMapName.setFont(new ASFont("宋体", 12, false, false, false, false));
			var filter:GlowFilter;
			filter = new GlowFilter(0x000000, 1, 2, 2, 100);
			labelMapName.setTextFilters(new Array(filter));
			
			labelMoney.setForeground(new ASColor(0xFFFFFF, 1));
			labelMoney.setFont(new ASFont("宋体", 12, false, false, false, false));
			labelMoney.setTextFilters(new Array(filter));
			
			labelIngot.setForeground(new ASColor(0xFFFFFF, 1));
			labelIngot.setFont(new ASFont("宋体", 12, false, false, false, false));
			labelIngot.setTextFilters(new Array(filter));
			
			//labelMoneyName.setForeground(new ASColor(0x00FF00, 1));
			//labelMoneyName.setFont(new ASFont("宋体", 12, false, false, false, false));
			//labelMoneyName.setTextFilters(new Array(filter));
			
			labelMapPosition.setText("126,123");
			labelMapPosition.setForeground(new ASColor(0xFFFFFF, 1));
			labelMapPosition.setTextFilters(new Array(filter));
			labelMapPosition.setFont(new ASFont("宋体", 12, false, false, false, false));
			
			labelButtonLine.setText("1线");
			labelButtonLine.setForeground(new ASColor(0xFFFFFF, 1));
			labelButtonLine.setFont(new ASFont("宋体", 12, false, false, false, false));
			labelButtonLine.setTextFilters(new Array(filter));

			//panel_pet_head.addEventListener(MouseEvent.CLICK,onPet);
			//panel_char_head.addEventListener(MouseEvent.CLICK,onChar);
			//panelStamina.addEventListener(MouseEvent.CLICK,onBtnAddStamina);
			btn_bag.addActionListener(onBtnBag);	
			btn_char.addActionListener(onClickChar);
			btn_pet.addActionListener(onBtnPet);
			btn_lover.addActionListener(onBtnLover);
			btn_slave.addActionListener(onBtnSlave);
			//btn_date.addActionListener(onDate);
			//btn_channel.addActionListener(onChannel);
			var txtFormat:TextFormat = new TextFormat("宋体", 13, 0xffffff, false, false, false);
			txt_field.setDefaultTextFormat(txtFormat);
			txt_field.addActionListener(onSend);
			txt_field.addEventListener(AWEvent.FOCUS_GAINED,onChatInputFucusGained);
			txt_field.addEventListener(AWEvent.FOCUS_LOST,onChatInputFucusLost);

			txt_field.addEventListener(KeyboardEvent.KEY_DOWN,onKeyDown,false,0,true);

			txt_field.filters = new Array(new GlowFilter(0x000000, 1, 2, 2, 2));
			txt_field.setClipMasked(false);

			//txt_field.alpha = 0.5;
			btn_send.addActionListener(onSend);
			btn_channel.addActionListener(onBtnChannel);
			btn_friend.addActionListener(onBtnFriend);
			btn_battle.addActionListener(onBtnBattle);
			btn_trend.addActionListener(onBtnTrends);
			//btn_bag.setFont(new ASFont("宋体", 14, true, false, false, false));
			//btn_bag.setTextFilters(new Array(filter));
			//btn_friend.setFont(new ASFont("宋体", 14, true, false, false, false));
			//btn_friend.setTextFilters(new Array(filter));
			//btn_task.setFont(new ASFont("宋体", 14, true, false, false, false));
			//btn_task.setTextFilters(new Array(filter));
			//btn_battle.setFont(new ASFont("宋体", 14, true, false, false, false));
			//btn_battle.setTextFilters(new Array(filter));
			//btn_return.setFont(new ASFont("宋体", 14, true, false, false, false));
			//btn_return.setTextFilters(new Array(filter));
			//btn_return.addActionListener(onBtnReturn);
			
			setImages();
			labelButtonLine.addActionListener(onBtnSelectLine);

			//btn_team_leader.addActionListener(onBtnTeamLeader);
			//btn_team_leader_p.addActionListener(onBtnTeamLeaderP);
			//panelMap.addEventListener(MouseEvent.CLICK,onMap);
			//btn_trip.addActionListener(onBtnTrip);
			//btn_pair.addActionListener(onBtnPair);
			btn_add.addActionListener(onBtnAddStamina);
			
			labelCharName.setForeground(new ASColor(0xFFFFFF, 1));
			labelCharName.setFont(new ASFont("宋体", 12, false, false, false, false));
			labelCharName.setTextFilters(new Array(filter));
			
			labelLevelChar.setForeground(new ASColor(0xFFFFFF, 1));
			labelLevelChar.setFont(new ASFont("宋体", 12, false, false, false, false));
			labelLevelChar.setTextFilters(new Array(filter));
			
			labelCharNameP.setForeground(new ASColor(0xFFFFFF, 1));
			labelCharNameP.setFont(new ASFont("宋体", 12, false, false, false, false));
			labelCharNameP.setTextFilters(new Array(filter));
			
			labelLevelP.setForeground(new ASColor(0xFFFFFF, 1));
			labelLevelP.setFont(new ASFont("宋体", 12, false, false, false, false));
			labelLevelP.setTextFilters(new Array(filter));
			
			labelMoney.setForeground(new ASColor(0xFFFFFF, 1));
			labelMoney.setFont(new ASFont("宋体", 12, false, false, false, false));
			labelMoney.setTextFilters(new Array(filter));
			
			btn_hide.addActionListener(onBtnShowHide);
			//btn_record.addActionListener(onBtnRecord);
			btn_rank.addActionListener(onBtnRank);
			btn_shop.addActionListener(onBtnMall);
			//btnChat.addActionListener(onBtnChat);
			//btnChat.setForeground(new ASColor(0x00FF00, 1));
			//btnChat.setFont(new ASFont("宋体", 12, false, false, false, false));
			//btnChat.setTextFilters(new Array(filter));
			
			//panel_char_head.buttonMode = true;
			//panel_pet_head.buttonMode = true;
			//panel_char_head_p.buttonMode = true;
			//panel_pet_head_p.buttonMode = true;
			//panelStamina.buttonMode = true;
			//panelMap.buttonMode = true;
			//panelTasks.setEnabled(false);
			//txtTask.filters = new Array(new GlowFilter(0x000000, 1, 2, 2, 100));
			//txtTask.setEnabled(false);
			panelNorthBigButtons.setEnabled(false);
			setDropTrigger(true);
			//panelChatFrame.setEnabled(false);
			setDragAcceptableInitiatorAppraiser(onDropAppraiser);
			addEventListener(DragAndDropEvent.DRAG_DROP, FrameBag.onDragDropPanelMain);
			
			Client.getInstance().addEventListener("501", phAddEXP_501);
			Client.getInstance().addEventListener("502", phAddMoney_502);
			this.setClipMasked(false);
			panelNorth.setEnabled(false);
			panelSouthButtons.setClipMasked(false);
			panelSouth.setClipMasked(false);
			panelPet.setClipMasked(false);
			addChild(new FPS());
			
		}
		
		//是否接受这个被拖入的组件
		private function onDropAppraiser(initiator:JPanel):Boolean
		{
			return true;
		}

		public function onEnterBattle():void
		{
			remove(panelEast);
			remove(panelWest);
			FrameBuff.hide();
			FrameHomeMain.hide();
			hideAll();
			
		}
		public function onLeaveBattle():void
		{
			append(panelEast);
			append(panelWest);
			bringToBottom(panelWest);
			bringToBottom(panelEast);
			FrameBuff.show();
			FrameHomeMain.show();
			bringToBottom(SceneMain.getInstance());
		}
		
		public function onEnterTalk():void
		{
			remove(panelEast);
			remove(panelWest);
			remove(panelNorth);
			remove(panelSouth);
			remove(panelCenter);
			FrameBuff.hide();
			FrameHomeMain.hide();
			FrameChat.hide();
			hideAll();
			
		}
		public function onLeaveTalk():void
		{
			append(panelEast);
			append(panelWest);
			append(panelNorth);
			append(panelSouth);
			append(panelCenter);
			FrameBuff.show();
			FrameHomeMain.show();
			FrameChat.show();
			bringToBottom(panelWest);
			bringToBottom(panelEast);
			bringToBottom(panelNorth);
			bringToBottom(panelSouth);
			bringToBottom(panelCenter);
			if(this.contains(SceneMain.getInstance()))
				bringToBottom(SceneMain.getInstance());
			if(this.contains(SceneBattle.getInstance()))
				bringToBottom(SceneBattle.getInstance());
			
			if(PanelMain.getInstance().isInBattle)
				onEnterBattle();
		}
		
		public function hideAll():void
		{
			FrameBag.hide();
			FrameBattleSetting.hide();
			FrameChar.hide();
			FrameChatRecord.hide();
			FrameClickChar.hide();
			FrameClickMapChar.hide();
			FrameFriend.hide();
			FrameFriendChat.hide();
			FrameLover.hide();
			FrameMall.hide();
			FrameNPCDialog.hide();
			FramePet.hide();
			FrameRank.hide();
			FrameSelectLine.hide();
			FrameSlave.hide();
			FrameStrengthen.hide();
			FrameTask.hide();
			FrameTrade.hide();
			FrameTrends.hide();
			FrameWChar.hide();
		}
		private static var _instance:* = null;
		public static function getInstance():PanelMainHelp
		{
			if(_instance == null)
				_instance = new PanelMainHelp();
			return _instance;
		}
		private var _filterArray:Array = new Array(new GlowFilter(0xffff00, 1, 20, 20));
		private function onRollOver(event:MouseEvent):void
		{
			event.target.filters = _filterArray;
		}
		
		private function onRollOut(event:MouseEvent):void
		{
			event.target.filters = null;
		}
		
		protected function onBtnShowHide(e:Event):void
		{
			SceneBase.showAllPlayer += 1;
			if(SceneBase.showAllPlayer >= SceneBase.ShowAllCount)
				SceneBase.showAllPlayer = SceneBase.ShowAll;
			//public static var ShowAllNPCPlayerSelf:int = 1;
			//public static var ShowAllNPCSelf:int = 2;
			//public static var ShowAllSelf:int = 3;
			//public static var ShowAllCount:int = 4;
			if(SceneBase.showAllPlayer == SceneBase.ShowAll)
			{
				PanelMain.showInfoTimeLimit("显示所有");
				btn_hide.setToolTipText("显示所有");
			}
			if(SceneBase.showAllPlayer == SceneBase.ShowAllNPCPlayerSelf)
			{
				PanelMain.showInfoTimeLimit("只显示NPC和所有玩家");
				btn_hide.setToolTipText("只显示NPC和所有玩家");
			}
			if(SceneBase.showAllPlayer == SceneBase.ShowAllNPCSelf)
			{
				PanelMain.showInfoTimeLimit("只显示NPC和自己");
				btn_hide.setToolTipText("只显示NPC和自己");
			}
			if(SceneBase.showAllPlayer == SceneBase.ShowAllSelf)
			{
				PanelMain.showInfoTimeLimit("只显示自己");
				btn_hide.setToolTipText("只显示自己");
			}
			SceneMain.getInstance().showAllPlayers();
			//btn_show_hide.setText(SceneBase.showAllPlayer?"隐藏":"显示");
		}
		//protected function onBtnTeamLeader(e:Event):void
		//{
		//	FrameClickTeamLeader.show(panelChar.x+e.target.x+e.target.width,panelChar.y+e.target.y+e.target.height/2+panelNorth.height);
		//}
		protected function onBtnTeamLeaderP(e:Event):void
		{
			//FrameClickTeamLeader.show(panelCharP.x+e.target.x+e.target.width,panelCharP.y+e.target.y+e.target.height/2+panelNorth.height);//
		}
		protected function onBtnChat(e:Event):void
		{
			FrameChatRecord.show();
		}
		protected function onBtnFaction(e:Event):void
		{
			FrameFaction.show();
		}
		protected function onBtnPair(e:Event):void
		{
			FramePair.show();
		}
		protected function onBtnAddStamina(e:Event):void
		{
			FrameAddStamina.show();
		}
		//protected function onChannel(e:Event):void
		//{
		//	bCurrent = !bCurrent;
		//	btn_channel.wrapSimpleButton(Client.getUIElement(bCurrent ? "btn_chat_current" : "btn_chat_world") as SimpleButton);
		//}
		protected function onBtnSelectLine(e:Event):void
		{
			FrameSelectLine.show();
		}
		protected function onClickPartner(e:Event):void
		{
			if(CharInfo.m_nBattlePartnerType == PanelMain.PARTNER_TYPE_LOVER)
			{
				FrameLover.show();
				return;
			}
			if(CharInfo.m_nBattlePartnerType == PanelMain.PARTNER_TYPE_SLAVE)
			{
				FrameSlave.show();
				return;
			}
			FramePet.show();
		}
		protected function onBtnPet(e:Event):void
		{
			FramePet.show();
		}
		protected function onBtnSlave(e:Event):void
		{
			FrameSlave.show();
		}
		protected function onBtnLover(e:Event):void
		{
			FrameLover.show();
		}
		protected function onBtnTeam(e:Event):void
		{
			FrameTeam.show();
		}
		protected function onBtnTrends(e:Event):void
		{
			FrameTrends.show();
		}

		protected function onBtnHome(e:Event):void
		{
			Home.visitHome(int(CharInfo.charId));
		}

		protected function onBtnRank(e:Event):void
		{
			FrameRank.show();
		}
		protected function onBtnMall(e:Event):void
		{
			FrameMall.show();
		}
		protected function onClickChar(e:Event):void
		{
			//if(e.target == btn_team_leader)
			//	return;
			//if(FrameClickTeamLeader.isShowing())
			//	return;
			//trace("e.target:",e.target);
			//trace("e.currentTarget:",e.currentTarget);
			FrameChar.show();
		}
		protected function onBtnBag(e:Event):void
		{
			FrameBag.show();
		}
		protected function onBtnFriend(e:Event):void
		{
			if(!FrameChar.isArchiveComplete())
			{
				return;
			}
			if(FrameFriendChat.messages.length > 0)
			{
				if(FrameFriendChat.isShowing())
				{
					FrameFriendChat.hide();
				}
				var item:Object = FrameFriendChat.messages[0];
				FrameFriendChat.show(item);
				FrameFriendChat.messages.splice(0,1);
				return;
			}
			FrameFriend.show();
		}
		protected function onBtnBattle(e:Event):void
		{
			FrameBattleSetting.show();
		}
	
		static public var _channel:int = 2;
		protected function onBtnChannel(e:Event):void
		{
			FrameSelectChannel.show();
			return;
		}
		public function updateChannel(channel:int):void
		{
			_channel = channel;
			
			if(_channel == 1)
				btn_channel.wrapSimpleButton(Client.getUIElement("btn_channel_current") as SimpleButton);
			if(_channel == 2)
				btn_channel.wrapSimpleButton(Client.getUIElement("btn_channel_world") as SimpleButton);
			if(_channel == 3)
				btn_channel.wrapSimpleButton(Client.getUIElement("btn_channel_faction") as SimpleButton);
			if(_channel == 4)
				btn_channel.wrapSimpleButton(Client.getUIElement("btn_channel_team") as SimpleButton);
		}
		public function updateMapInfo():void
		{
			labelButtonLine.setText(CharInfo.mapLineId == 0 ? '幻境' : CharInfo.mapLineId.toString()+"线");
			//labelButtonLine.setEnabled(CharInfo.mapLineId != 0);
			if(Home.isInHome())
			{
				labelMapName.setText(Home.homeInfo.m_szCharName);
			}
			else
			{
				var objMapCSV:Object = Client.getInstance().GetMapCSV(CharInfo.mapId);
				if(objMapCSV != null)
					labelMapName.setText(objMapCSV.name);
			}
			panelSmallMap.update();
		}
		private var _sendMsg:Array = new Array();
		private var _sendMsgIndex:int = 0;
		private var _prevChatTime:int = 0;
		protected function onSend(e:Event):void
		{
			if(txt_field.getText().length == 0)
				return;
			if(txt_field.getText().length > 140)
			{
				PanelMain.showInfoTimeLimit("发送消息长度不能超过140个字节！");
				return;
			}
			if(_prevChatTime != 0 && (getTimer() - _prevChatTime) < 3 *1000)
			{
				var text:String = new String;
				text += '说话速度太快,请在<font color=\"#FF0000\">' + (3 - int((getTimer() - _prevChatTime)/1000)) + '</font>秒后再试!';
				FrameChat.getInstance().addSystemMessage(text);
				return;
			}
			Client.getInstance().sendPacketLogic(1000,[_channel,txt_field.getText()]);
			_sendMsg.push(txt_field.getText());
			if(_sendMsg.length >= 20)
				_sendMsg.splice(0,1);
			_sendMsgIndex = _sendMsg.length;
			txt_field.setText("");
			_prevChatTime = getTimer();
		}
		private function onChatInput(e:Event):void
		{
			//labelMoney.setText((int(txtWood.getText())+int(txtFood.getText())).toString()+'/'+CharInfo.money);
			var str:String = txt_field.getText();
			//Client.wordFilter(str);
			txt_field.setText(Client.wordFilter(str));
		}
		private function onChatInputFucusGained(event:AWEvent):void
		{
			//txt_field.alpha = 1;
		}
		
		private function onChatInputFucusLost(event:AWEvent):void
		{
			//txt_field.alpha = 0.5;
		}
		protected function onBtnTaskList(e:Event):void
		{
			panelTasks.visible = !panelTasks.visible;
		}
		

		protected function onKeyDown(e:KeyboardEvent):void
		{
			if(_sendMsg.length <= 0)
				return;
			switch(e.keyCode)
			{
				case 38:
					// W & UP
					_sendMsgIndex--;
					if(_sendMsgIndex < 0) 
						_sendMsgIndex = _sendMsg.length - 1;
					txt_field.setText(_sendMsg[_sendMsgIndex]);
					break;
				case 40:
					// S & DOWN
					_sendMsgIndex++;
					if(_sendMsgIndex >= _sendMsg.length) 
						_sendMsgIndex = 0;
					txt_field.setText(_sendMsg[_sendMsgIndex]);
					break;
			}
		}

		public function setImages():void
		{
			panelChar.setBackgroundDecorator(new AssetBackground(Client.getUIElement("img_char_bg") as DisplayObject));
			panelPet.setBackgroundDecorator(new AssetBackground(Client.getUIElement("img_pet_bg") as DisplayObject));
			panelMapFrame.setBackgroundDecorator(new AssetBackground(Client.getUIElement("img_map_info_bg") as DisplayObject));
			panelSmallMap.setBackgroundDecorator(new AssetBackground(Client.getUIElement("img_map_small_bg") as DisplayObject));
			txt_field.setBackgroundDecorator(null);
			panelSouthChats.setBackgroundDecorator(null);
			labelCharName.setClipMasked(false);
			labelButtonLine.setBackgroundDecorator(null);
			labelButtonLine.setForeground(ASColor.WHITE);
			labelButtonLine.setRollOverColor(ASColor.YELLOW);
			labelButtonLine.setPressedColor(ASColor.YELLOW);
			//labelButtonLine.setBackground(ASColor.WHITE);
			//labelButtonLine.setMideground(ASColor.WHITE);
			//CursorManager.getManager().setCursor(this,Client.getUIElement("img_cursor") as DisplayObject);
			CursorManager.getManager().setCursor(SceneMain.getInstance(),Client.getUIElement("img_cursor") as DisplayObject);
			CursorManager.getManager().setCursor(SceneBattle.getInstance(),Client.getUIElement("img_cursor") as DisplayObject);
			
			btn_shop.wrapSimpleButton(Client.getUIElement("btn_shop") as SimpleButton);
			btn_battle.wrapSimpleButton(Client.getUIElement("btn_battle") as SimpleButton);
			btn_char.wrapSimpleButton(Client.getUIElement("btn_char") as SimpleButton);
			btn_pet.wrapSimpleButton(Client.getUIElement("btn_pet") as SimpleButton);
			btn_lover.wrapSimpleButton(Client.getUIElement("btn_lover") as SimpleButton);
			btn_bag.wrapSimpleButton(Client.getUIElement("btn_bag") as SimpleButton);
			btn_friend.wrapSimpleButton(Client.getUIElement("btn_friend") as SimpleButton);
			btn_slave.wrapSimpleButton(Client.getUIElement("btn_slave") as SimpleButton);
			btn_team.wrapSimpleButton(Client.getUIElement("btn_team") as SimpleButton);
			btn_home.wrapSimpleButton(Client.getUIElement("btn_home") as SimpleButton);
			btn_motion.wrapSimpleButton(Client.getUIElement("btn_motion") as SimpleButton);
			btn_channel.wrapSimpleButton(Client.getUIElement("btn_channel_world") as SimpleButton);
			btn_faction.wrapSimpleButton(Client.getUIElement("btn_faction") as SimpleButton);
			btn_shop.setText("");
			btn_battle.setText("");
			btn_char.setText("");
			btn_pet.setText("");
			btn_lover.setText("");
			btn_bag.setText("");
			btn_friend.setText("");
			btn_slave.setText("");
			btn_team.setText("");
			btn_motion.setText("");
			btn_send.setText("");
			btn_home.setText("");
			btn_faction.setText("");
			btn_channel.setText("");
			
			btn_copy.wrapSimpleButton(Client.getUIElement("btn_copy") as SimpleButton);
			btn_copy.setText("");
			btn_copy.addActionListener(function ():void{FrameCopy.show()});
			
			btn_faction.addActionListener(onBtnFaction);
			btn_home.addActionListener(onBtnHome);
			btn_team.addActionListener(onBtnTeam);
			btn_details.addActionListener(function (e:Event):void{FrameTask.show();});
			btn_world.addActionListener(function (e:Event):void{FrameWorldMap.show();});
			
			btn_voice.wrapSimpleButton(Client.getUIElement("btn_voice") as SimpleButton);
			btn_voice.setText("");
			btn_vip.wrapSimpleButton(Client.getUIElement("btn_vip") as SimpleButton);
			btn_vip.setText("");
			btn_recharge.wrapSimpleButton(Client.getUIElement("btn_recharge") as SimpleButton);
			btn_recharge.setText("");
			btn_add.wrapSimpleButton(Client.getUIElement("btn_add") as SimpleButton);
			btn_add.setText("");
			
			btn_accepted_task.wrapSimpleButton(Client.getUIElement("btn_accepted_task") as SimpleButton);
			btn_accepted_task.setText("");
			btn_acceptable_task.wrapSimpleButton(Client.getUIElement("btn_acceptable_task") as SimpleButton);
			btn_acceptable_task.setText("");
			btn_details.wrapSimpleButton(Client.getUIElement("btn_details") as SimpleButton);
			btn_details.setText("");
			
			var group:ButtonGroup = new ButtonGroup();
			group.appendAll(btn_accepted_task,btn_acceptable_task);
			btn_accepted_task.setSelected(true);
			
			var img_chat_background:DisplayObject = Client.getUIElement("img_chat_input_bg") as DisplayObject
			panelSouthChats.setBackgroundDecorator(new AssetBackground(img_chat_background));
			panelSouthChats.setBorder(new EmptyBorder());
			panelSouthBottom.setBackgroundDecorator(new AssetBackground(Client.getUIElement("img_bottom_bg") as DisplayObject));
			panelHead.setBackgroundDecorator(new AssetBackground(Client.getUIElement("img_head") as DisplayObject));
			panelHeadP.setBackgroundDecorator(new AssetBackground(Client.getUIElement("img_head") as DisplayObject));
			
			//btn_motion.wrapSimpleButton(Client.getUIElement("btn_motion") as SimpleButton);
			btn_send.wrapSimpleButton(Client.getUIElement("btn_send") as SimpleButton);
			
			btn_world.wrapSimpleButton(Client.getUIElement("btn_world") as SimpleButton);
			btn_rank.wrapSimpleButton(Client.getUIElement("btn_rank") as SimpleButton);
			btn_trend.wrapSimpleButton(Client.getUIElement("btn_trend") as SimpleButton);
			btn_hide.wrapSimpleButton(Client.getUIElement("btn_hide") as SimpleButton);
			btn_world.setText("");
			btn_rank.setText("");
			btn_trend.setText("");
			btn_hide.setText("");
			btn_task_list.wrapSimpleButton(Client.getUIElement("btn_list") as SimpleButton);
			btn_task_list.addActionListener(onBtnTaskList);
			btn_task_list.setText("");
			
			//txtTask.setBackgroundDecorator(null);
			panelTask.setBackgroundDecorator(null);
			panelTasks.setBackgroundDecorator(null);
			panelTask.setEnabled(false);
			panelTasks.setEnabled(false);
			panelTask.pack();
			//txtTask.addEventListener(TextEvent.LINK, linkHandlerTask);
			panelTasks.addEventListener(MouseEvent.ROLL_OVER, onRollOverTask);
			panelTasks.addEventListener(MouseEvent.ROLL_OUT, onRollOutTask);
			panelHead.addEventListener(MouseEvent.ROLL_OVER, onRollOver);
			panelHead.addEventListener(MouseEvent.ROLL_OUT, onRollOut);
			panelHeadP.addEventListener(MouseEvent.ROLL_OVER, onRollOver);
			panelHeadP.addEventListener(MouseEvent.ROLL_OUT, onRollOut);
			panelHead.buttonMode = true;
			panelHeadP.buttonMode = true;
			panelHead.addEventListener(MouseEvent.CLICK,onClickChar);
			panelHeadP.addEventListener(MouseEvent.CLICK,onClickPartner);
			btn_accepted_task.addActionListener(onBtnAcceptedTask);
			btn_acceptable_task.addActionListener(onBtnAcceptableTask);
			
			txt_field.addEventListener(FocusKeyEvent.FOCUS_KEY_UP,onChatInput);
		}
		private function onRollOverTask(event:MouseEvent):void
		{
			//var target:JPanel = event.target as JPanel;
			if(panelTasks.getBackgroundDecorator() != null)
				return;
			
			var myMatrix:Matrix = new Matrix();
			myMatrix.createGradientBox(panelTasks.width, panelTasks.height, 1.6, 50, 50);
			var myColors:Array = [0x033332, 0x033344];
			var myAlphaS:Array = [100, 100];
			var myRalphaS:Array = [0, 225];
			//graphics.beginGradientFill(GradientType.LINEAR, myColors, myAlphaS, myRalphaS, myMatrix);
			//graphics.drawRoundRectComplex(50,50,100,100,10,10,10,10);
			
			//var squareSize:uint = 100;
			var square:Sprite = new Sprite();
			/*square.graphics.beginFill(0xFF0000, 0.5);
			square.graphics.drawRect(0, 0, squareSize, squareSize);
			square.graphics.beginFill(0x00FF00, 0.5);
			square.graphics.drawRect(200, 0, squareSize, squareSize);
			square.graphics.beginFill(0x0000FF, 0.5);
			square.graphics.drawRect(400, 0, squareSize, squareSize);
			square.graphics.endFill();*/
			
			//square.graphics.beginGradientFill(GradientType.LINEAR, myColors, myAlphaS, myRalphaS, myMatrix);
			square.graphics.beginFill(0x033332, 0.8);
			square.graphics.drawRoundRectComplex(0,0,panelTasks.width,panelTasks.height,5,5,5,5);
			square.graphics.endFill();
			
			//this.addChild(square);
			
			//var bitmapData:BitmapData = new BitmapData(panelList.width,panelList.height,true,0x000000);
			//bitmapData.draw(square);
			//var bitmap:Bitmap = new Bitmap(bitmapData);
			


			panelTasks.setBackgroundDecorator(new AssetBackground(square as DisplayObject));
			
			//panelList.setBackgroundDecorator(new SolidBackground(new ASColor(0x033332,0.8)));
			
			panelTasks.paintImmediately();
		}
		
		private function onRollOutTask(event:MouseEvent):void
		{
			//var target:JTextArea = event.target as JTextArea;
			panelTasks.setBackgroundDecorator(null);
			panelTasks.paintImmediately();
		}
		
		
		static public function formatTime(time:int):String
		{
			var str:String = new String;
			var hour:int = time / 3600;
			var min:int = (time % 3600)/60;
			var second:int = time%60;
			if(hour > 0)str += ((hour < 10) ? "0" : "") + hour+':';
			if(min >= 0)str += ((min < 10) ? "0" : "") + min+':';
			str += ((second < 10) ? "0" : "") + second;
			return str;
		}
		protected function onBtnAcceptedTask(e:Event):void
		{
			updateTasks(false);
		}
		protected function onBtnAcceptableTask(e:Event):void
		{
			if(!btn_acceptable_task.isSelected())
				return;
			//txtTask.setHtmlText(FrameTask._task_info_acceptable);
			updateAcceptableTasks();
		}
		public function updateAcceptableTasks():void
		{
			for each (var panel:PanelMainAcceptedTaskItem in arrayPanelAcceptedTasks)
			{
				if(panelTasks.contains(panel))
					panelTasks.remove(panel);
			}
			for each (var panel1:PanelMainAcceptableTaskItem in arrayPanelAcceptableTasks)
			{
				if(panelTasks.contains(panel1))
					panelTasks.remove(panel1);
			}
			
			var panelWidth:int = 190;
			var panelHeight:int = 0;
			var i:int = 0;
			var array:Array = FrameTask.getAcceptableTasks();
			for each(var _objTaskInfo:Object in array)
			{
				if(_objTaskInfo.task_id == -1)
					continue;
				if(arrayPanelAcceptableTasks[i] == null)
					arrayPanelAcceptableTasks[i] = new PanelMainAcceptableTaskItem;
				arrayPanelAcceptableTasks[i].item = _objTaskInfo;
				if(!panelTasks.contains(arrayPanelAcceptableTasks[i]))
				{
					//arrayPanelAcceptableTasks[i].pack();
					//arrayPanelAcceptableTasks[i].paintImmediately();
					(arrayPanelAcceptableTasks[i] as PanelMainAcceptableTaskItem).setLocationXY(0,panelHeight);
					panelHeight += arrayPanelAcceptableTasks[i].height;
					panelTasks.append(arrayPanelAcceptableTasks[i]);
				}
				i++;
			}
			if(panelHeight < 20 * i)
				panelHeight = 20 * i;
			panelTasks.setPreferredWidth(panelWidth);
			panelTasks.setPreferredHeight(panelHeight);
			panelTasks.setSizeWH(panelWidth,panelHeight);
			//panelTasks.setPreferredHeight(-1);
			panelTasks.pack();
			panelTasks.paintImmediately();
			panelTask.pack();
			panelTask.paintImmediately();
			pack();
			paintImmediately();
		}
		private var arrayPanelAcceptableTasks:Array = [];
		private var arrayPanelAcceptedTasks:Array = [];
		public function updateTasks(check:Boolean = true):void
		{
			for each (var panel:PanelMainAcceptedTaskItem in arrayPanelAcceptedTasks)
			{
				if(panelTasks.contains(panel))
					panelTasks.remove(panel);
			}
			
			if(!check && !btn_accepted_task.isSelected())
				return;
			if(check)
			{
				if(CharInfo.m_arTasks.length == 0) 
				{
					btn_accepted_task.setSelected(false);
					btn_acceptable_task.setSelected(true);
					//txtTask.setHtmlText(FrameTask._task_info_acceptable);
					updateAcceptableTasks();
					return;
				}
				else
				{
					btn_acceptable_task.setSelected(false);
					btn_accepted_task.setSelected(true);
				}
			}

			for each (var panel1:PanelMainAcceptableTaskItem in arrayPanelAcceptableTasks)
			{
				if(panelTasks.contains(panel1))
					panelTasks.remove(panel1);
			}
			
			var panelWidth:int = 190;
			var panelHeight:int = 0;
			var i:int = 0;
			for each(var _objTaskInfo:Object in CharInfo.m_arTasks)
			{
				if(_objTaskInfo.task_id == -1)
					continue;
				if(arrayPanelAcceptedTasks[i] == null)
					arrayPanelAcceptedTasks[i] = new PanelMainAcceptedTaskItem;
				arrayPanelAcceptedTasks[i].item = _objTaskInfo;
				if(!panelTasks.contains(arrayPanelAcceptedTasks[i]))
				{
					//arrayPanelAcceptedTasks[i].pack();
					//arrayPanelAcceptedTasks[i].paintImmediately();
					(arrayPanelAcceptedTasks[i] as PanelMainAcceptedTaskItem).setLocationXY(0,panelHeight);
					panelHeight += arrayPanelAcceptedTasks[i].height;
					panelTasks.append(arrayPanelAcceptedTasks[i]);
				}
				i++;
			}
			
			if(panelHeight < 40 * i)
				panelHeight = 40 * i;
			
			panelTasks.setPreferredWidth(panelWidth);
			panelTasks.setPreferredHeight(panelHeight);
			panelTasks.setSizeWH(panelWidth,panelHeight);
			//panelTasks.setPreferredHeight(-1);
			panelTasks.pack();
			panelTasks.paintImmediately();
			panelTask.pack();
			panelTask.paintImmediately();
			pack();
			paintImmediately();
		}
		public static var tmpNpcId:int = -1;
		public static var tmpMapId:int = 0;
		public static var tmpMapX:int = 0;
		public static var tmpMapY:int = 0;
		private function linkHandlerTask(linkEvent:TextEvent):void 
		{
			//FrameInfo.showMessageDialog("","你已经到了"+linkEvent.text+"!");
			var dtemp:Array = (linkEvent.text as String).split(',');
			if(dtemp.length == 3)
			{
				Client.getInstance().sendPacketLogic(9,[int(dtemp[0]),CharInfo.mapLineId,int(0),int(0),int(dtemp[1]),int(dtemp[2])]);
			}
			if(dtemp.length == 2)
			{
				tmpMapId = int(dtemp[0]);
				tmpNpcId = int(dtemp[1]);
				var objMapCSV:Object = Client.getInstance().GetMapCSV(tmpMapId);
				if(objMapCSV == null)
				{
					return;
				}
				if(tmpMapId != CharInfo.mapId)
				{
					tmpMapX = int(objMapCSV.base_x);
					tmpMapY = int(objMapCSV.base_y);
					Client.getInstance().sendPacketLogic(9,[int(tmpMapId),CharInfo.mapLineId,int(0),int(0),int(objMapCSV.base_x),int(objMapCSV.base_y)]);
				}
				else
				{
					var npc:ObjectCharNPC = SceneMain.getInstance().getObjectByNpcId(tmpNpcId);
					if(npc != null)
					{
						if(Point.distance(npc.getPos(),CharInfo.objSelf.getPos()) > 100)
						{
							tmpMapX = int(npc.getPos().x);
							tmpMapY = int(npc.getPos().y);
							Client.getInstance().sendPacketLogic(9,[int(PanelMainHelp.tmpMapId),CharInfo.mapLineId,int(0),int(0),int(npc.getPos().x),int(npc.getPos().y)]);
							return;
						}
						
						FrameNPCDialog._currentCharNpc = npc;
						if(FrameNPCDialog._currentCharNpc != null)
						{
							Client.getInstance().sendPacketLogic(900,[int(PanelMainHelp.tmpNpcId)]);
							PanelMainHelp.tmpNpcId = -1;
							PanelMainHelp.tmpMapId = -1;
							PanelMainHelp.tmpMapX = 0;
							PanelMainHelp.tmpMapY = 0;
						}
					}
				}
			}
		}
		public function onCharInfoUpdate():void
		{
			labelCharName.setText(CharInfo.charName);
			labelCharName.setForeground(new ASColor(CharInfo.m_nGender == 0 ? Engine.colorBoy : Engine.colorGirl));
			labelLevelChar.setText(CharInfo.m_nLevel.toString());
			
			//panelChar.append(panelHP);
			//panelChar.append(panelEXP);
			//panelChar.append(panelStamina);
			
			//panelPet.append(panelHPP);
			//panelPet.append(panelEXPP);
			//panelPet.append(panelStaminaP);
			
			panelHP.updateValue(CharInfo.hpMax,CharInfo.hpMax);
			panelEXP.updateValue(CharInfo.exp,CharInfo.expMax);
			panelStamina.updateValue(CharInfo.stamina,CharInfo.staminaMax);
			
			panelHP.setToolTipText("生命:"+CharInfo.hpMax+'/'+CharInfo.hpMax);
			panelEXP.setToolTipText("经验:"+CharInfo.exp+'/'+CharInfo.expMax);
			panelStamina.setToolTipText("精力:"+CharInfo.stamina+'/'+CharInfo.staminaMax);
			
			//panelHPP.updateValue(CharInfo.hpMax,CharInfo.hpMax);
			//panelEXPP.updateValue(CharInfo.exp,CharInfo.expMax);
			//panelStaminaP.updateValue(CharInfo.stamina,CharInfo.staminaMax);
			
			//panelHPP.setToolTipText("生命:"+CharInfo.hpMax+'/'+CharInfo.hpMax);
			//panelEXPP.setToolTipText("经验:"+CharInfo.exp+'/'+CharInfo.expMax);
			//panelStaminaP.setToolTipText("精力:"+CharInfo.stamina+'/'+CharInfo.staminaMax);
			
			panelStamina.setTextVisible(true);
			//panelStaminaP.setTextVisible(true);

			//labelEXPValue.setText(CharInfo.exp+'/'+CharInfo.expMax);
			
			//labelStaminaValue.setText(CharInfo.stamina+'/'+CharInfo.staminaMax);
			labelIngot.setText(CharInfo.ingot.toString());
			labelMoney.setText(CharInfo.money.toString());
			paintImmediately();

			if(CharInfo.m_nGender == 0)
				txt_field.setForeground(new ASColor(Engine.colorBoy));
			if(CharInfo.m_nGender == 1)
				txt_field.setForeground(new ASColor(Engine.colorGirl));
		}
		
		public function onPartnerInfoUpdate():void
		{
			
			labelCharNameP.setText("");
			labelLevelP.setText("");
			panelHPP.updateValue(0,0);
			panelEXPP.updateValue(0,0);
			//panelStaminaP.updateValue(0,0);
			
			panelHPP.setToolTipText("");
			panelEXPP.setToolTipText("");
			//panelStaminaP.setToolTipText("");
			
			var obj:Object = null
			if(CharInfo.m_nBattlePartnerType == PanelMain.PARTNER_TYPE_PET)
			{
				if(CharInfo.m_nPetJoinBattleIndex == -1)return;
				obj = CharInfo.m_arPets[CharInfo.m_nPetJoinBattleIndex];
				if(obj == null) return;
				labelCharNameP.setText(obj.name);
				labelLevelP.setText(obj.m_nLevel);
				panelHPP.updateValue(obj.hp_max,obj.hp_max);
				panelEXPP.updateValue(obj.exp,obj.exp_max);
				//panelStaminaP.updateValue(obj.stamina,obj.staminaMax);
				
				panelHPP.setToolTipText("生命:"+obj.hp_max+'/'+obj.hp_max);
				panelEXPP.setToolTipText("经验:"+obj.exp+'/'+obj.exp_max);
				//panelStaminaP.setToolTipText("精力:"+obj.stamina+'/'+obj.staminaMax);
			}
			if(CharInfo.m_nBattlePartnerType == PanelMain.PARTNER_TYPE_LOVER)
			{
				obj = CharInfo.objLover;
				if(obj == null) return;
				labelCharNameP.setText(obj.m_szCharName);
				labelLevelP.setText(obj.m_nLevel);
				panelHPP.updateValue(obj.m_nHPMax,obj.m_nHPMax);
				//panelEXPP.updateValue(obj.exp,obj.exp_max);
				//panelStaminaP.updateValue(obj.stamina,obj.staminaMax);
				
				panelHPP.setToolTipText("生命:"+obj.m_nHPMax+'/'+obj.m_nHPMax);
				//panelEXPP.setToolTipText("经验:"+obj.exp+'/'+obj.exp_max);
				//panelStaminaP.setToolTipText("精力:"+obj.stamina+'/'+obj.staminaMax);
			}
			if(CharInfo.m_nBattlePartnerType == PanelMain.PARTNER_TYPE_SLAVE)
			{
				if(CharInfo.m_nSlaveJoinBattleIndex == -1)return;
				obj = CharInfo.m_arSlaves[CharInfo.m_nSlaveJoinBattleIndex];
				if(obj == null) return;
				
				labelCharNameP.setText(obj.m_szCharName);
				labelLevelP.setText(obj.m_nLevel);
				panelHPP.updateValue(obj.m_nHP,obj.m_nHP);
				//panelEXPP.updateValue(obj.exp,obj.exp_max);
				//panelStaminaP.updateValue(obj.stamina,obj.staminaMax);
				
				panelHPP.setToolTipText("生命:"+obj.m_nHP+'/'+obj.m_nHP);
				//panelEXPP.setToolTipText("经验:"+obj.exp+'/'+obj.exp_max);
				//panelStaminaP.setToolTipText("精力:"+obj.stamina+'/'+obj.staminaMax);
			}
			paintImmediately();
		}
		
		
		
		public function flashFriendButton():void
		{
			TweenMax.to(btn_friend, 0.2, {onComplete:onFinishFlashFriendButton,glowFilter:{color:0xffff00, alpha:1, blurX:30, blurY:30,strength:3}});
		}
		public function onFinishFlashFriendButton():void
		{
			btn_friend.filters = null;
			if(FrameFriendChat.messages.length > 0)
				flashFriendButton();
		}
		
		
		private function phAddEXP_501(e:PacketEvent):void
		{
			var msg:Array = e.data as Array;
			trace("phAddEXP_501", msg);
			var nIndex:uint = 0;
			var nValue:Number = msg[nIndex++];
			addAddEXPEffect(nValue);
		}
		
		private function phAddMoney_502(e:PacketEvent):void
		{
			var msg:Array = e.data as Array;
			trace("phAddMoney_502", msg);
			var nIndex:uint = 0;
			var nValue:Number = msg[nIndex++];
			addAddMoneyEffect(nValue);
		}
		
		//private var _arrayEXPPanels:Array = new Array;
		//private var _timeRemovePanels:Timer = null;
		public function addAddEXPEffect(exp:int):void
		{
			/*if(exp > 5000)
				return;
			
			var panel:JPanel = null;
			for(var i:int = 0; i < exp; i++)
			{
				panel = null;
				panel = new JPanel;
				PanelMainHelp.getInstance().addChild(panel);
				panel.setBackgroundDecorator(new AssetBackground(Client.getUIElement("img_add_exp") as DisplayObject));
				panel.setSizeWH(41,35);
				
				panel.x = (Engine.W - panel.width) / 2-100 + Math.round(Math.random()*10000)%200;
				panel.y = 350 + Math.round(Math.random()*10000)%100;//(Engine.H - panel.height) / 2;
				panel.addEventListener(MouseEvent.ROLL_OVER,function(event:MouseEvent):void
				{
					var target:JPanel = event.target as JPanel;
					showAddInfo('经验+1',target.x+target.width,target.y,0x4eb9ff,ASColor.BLACK.getARGB());
					TweenMax.to(target, 1, {bezier:[{x:panelEXP.x+150, y:panelEXP.y+10}, {x:panelEXP.x, y:panelEXP.y}],onComplete:function(pane:JPanel):void
					{
						TweenLite.to(pane, 0.5, {autoAlpha:0,onComplete:function(p:JPanel):void
						{
							if(PanelMainHelp.getInstance().containsChild(p))
								PanelMainHelp.getInstance().removeChild(p);
						},onCompleteParams:[pane]});
					},onCompleteParams:[target]});
				});

				var _time:TimerData = new TimerData(5000,1,panel);
				_time.addEventListener(TimerEvent.TIMER,function(event:TimerEvent):void
				{
					var pane:JPanel = event.target.arg[0];
					var time:TimerData = event.target as TimerData;
					time.stop();
					if(!PanelMainHelp.getInstance().containsChild(pane))
						return;
					var _timeShort:TimerData = new TimerData(50,60,pane,0);
					
					_timeShort.addEventListener(TimerEvent.TIMER,function(event:TimerEvent):void
					{
						var paneShort:JPanel = event.target.arg[0];
						var timeShort:TimerData = event.target as TimerData;
						var count:int = event.target.arg[1];
						if((count < 20 && count % 3 == 0) || (count >= 20 && count < 40 && count % 2 == 0) || count >= 40)
						{
							paneShort.scaleX = paneShort.scaleX != 1.2?1.2:1.0;
							paneShort.scaleY = paneShort.scaleY != 1.2?1.2:1.0;
						}
						if(!PanelMainHelp.getInstance().containsChild(paneShort))
						{
							timeShort.stop();
							return;
						}
						count++;
						event.target.arg[1] = count;
						if(count >= 60)
						{
							timeShort.stop();
							paneShort.scaleX = 1.0;
							paneShort.scaleY = 1.0;
							showAddInfo('经验+1',paneShort.x+paneShort.width,paneShort.y,0x4eb9ff,ASColor.BLACK.getARGB());
							TweenMax.to(paneShort, 2, {bezier:[{x:panelEXP.x+150, y:panelEXP.y+10}, {x:panelEXP.x, y:panelEXP.y}],ease:Back.easeIn,onComplete:function(pane:JPanel):void
							{
								TweenLite.to(pane, 0.5, {autoAlpha:0,onComplete:function(p:JPanel):void
								{
									if(PanelMainHelp.getInstance().containsChild(p))
										PanelMainHelp.getInstance().removeChild(p);
								},onCompleteParams:[pane]});
							},onCompleteParams:[paneShort]});
						}
						
					});
					_timeShort.start();

				});
				_time.start();
			}*/
		}
			
		public function addAddMoneyEffect(exp:int):void
		{
			/*if(exp > 5000)
				return;
			var panel:JPanel = null;
			for(var i:int = 0; i < exp; i++)
			{
				panel = null;
				panel = new JPanel;
				PanelMainHelp.getInstance().addChild(panel);
				panel.setBackgroundDecorator(new AssetBackground(Client.getUIElement("img_add_money") as DisplayObject));
				panel.setSizeWH(41,35);
				
				panel.x = (Engine.W - panel.width) / 2-100 + Math.round(Math.random()*10000)%200;
				panel.y = 350 + Math.round(Math.random()*10000)%100;//(Engine.H - panel.height) / 2;
				panel.addEventListener(MouseEvent.ROLL_OVER,function(event:MouseEvent):void
				{
					var target:JPanel = event.target as JPanel;
					showAddInfo('铜币+1',target.x+target.width,target.y,0xffff00,0x000000);
					
					TweenMax.to(target, 1, {bezier:[{x:panelMoney.x+150, y:panelMoney.y+10}, {x:panelMoney.x, y:panelMoney.y}],onComplete:function(pane:JPanel):void
					{
						TweenLite.to(pane, 0.5, {autoAlpha:0,onComplete:function(p:JPanel):void
						{
							if(PanelMainHelp.getInstance().containsChild(p))
								PanelMainHelp.getInstance().removeChild(p);
						},onCompleteParams:[pane]});
					},onCompleteParams:[target]});
				});
				var _time:TimerData = new TimerData(5000,1,panel);
				_time.addEventListener(TimerEvent.TIMER,function(event:TimerEvent):void
				{
					var pane:JPanel = event.target.arg[0];
					var time:TimerData = event.target as TimerData;
					time.stop();
					if(!PanelMainHelp.getInstance().containsChild(pane))
						return;
					
					var _timeShort:TimerData = new TimerData(50,60,pane,0);
					
					_timeShort.addEventListener(TimerEvent.TIMER,function(event:TimerEvent):void
					{
						var paneShort:JPanel = event.target.arg[0];
						var timeShort:TimerData = event.target as TimerData;
						var count:int = event.target.arg[1];
						if((count < 20 && count % 3 == 0) || (count >= 20 && count < 40 && count % 2 == 0) || count >= 40)
						{
							paneShort.scaleX = paneShort.scaleX != 1.2?1.2:1.0;
							paneShort.scaleY = paneShort.scaleY != 1.2?1.2:1.0;
						}
						if(!PanelMainHelp.getInstance().containsChild(paneShort))
						{
							timeShort.stop();
							return;
						}
						count++;
						event.target.arg[1] = count;
						if(count >= 60)
						{
							timeShort.stop();
							paneShort.scaleX = 1.0;
							paneShort.scaleY = 1.0;
							showAddInfo('铜币+1',paneShort.x+paneShort.width,paneShort.y,0xffff00,0x000000);
							TweenMax.to(paneShort, 2, {bezier:[{x:panelMoney.x+150, y:panelMoney.y+10}, {x:panelMoney.x, y:panelMoney.y}],ease:Back.easeIn,onComplete:function(pane:JPanel):void
							{
								TweenLite.to(pane, 0.5, {autoAlpha:0,onComplete:function(p:JPanel):void
								{
									if(PanelMainHelp.getInstance().containsChild(p))
										PanelMainHelp.getInstance().removeChild(p);
								},onCompleteParams:[pane]});
							},onCompleteParams:[paneShort]});
						}
						
					});
					_timeShort.start();
				});
				_time.start();
			}*/
		}
		
		public static function showAddInfo(message:String,x:int,y:int,fColor:uint=0xffff00,gColor:uint=0xff0000):void
		{
			var _chatBubbles:JTextArea = new JTextArea();
			_chatBubbles.setEditable(false);
			_chatBubbles.setWordWrap(true);
			_chatBubbles.setBorder( new EmptyBorder);
			_chatBubbles.setPreferredWidth(250);
			_chatBubbles.setBackgroundDecorator(null);
			var filter:GlowFilter;
			var font:ASFont = new ASFont("宋体", 14, true, false, false, false);
			filter = new GlowFilter(gColor, 1, 2, 2, 10);
			_chatBubbles.setFont(font);
			_chatBubbles.setForeground(new ASColor(fColor));
			_chatBubbles.getTextField().filters = (new Array(filter));
			_chatBubbles.setHtmlText(message);
			_chatBubbles.pack();
			_chatBubbles.x = x;
			_chatBubbles.y = y;
			PanelMainHelp.getInstance().addChild(_chatBubbles);
			
			TweenLite.to(_chatBubbles, 1, {x:_chatBubbles.x, y:_chatBubbles.y-30,onComplete:function(chatBubbles:JTextArea):void
			{
				if(PanelMainHelp.getInstance().containsChild(chatBubbles))
					PanelMainHelp.getInstance().removeChild(chatBubbles);
			},onCompleteParams:[_chatBubbles]});
			
		}
	}
}

	
import com.*;
import com.Engine.*;
import com.Packet.*;
import com.UI.*;

import flash.display.*;
import flash.events.*;
import flash.external.*;
import flash.filters.*;
import flash.geom.*;
import flash.net.*;
import flash.system.*;
import flash.text.*;
import flash.ui.*;
import flash.utils.*;

//import mx.containers.Panel;

import org.aswing.*;
import org.aswing.border.*;
import org.aswing.border.EmptyBorder;
import org.aswing.colorchooser.*;
import org.aswing.dnd.*;
import org.aswing.event.*;
import org.aswing.ext.*;
import org.aswing.geom.*;
import org.aswing.tree.AbstractLayoutCache;
	
/**
 * MyPaneSelectChannel
 */
class FrameSelectChannel  extends JFrame{
	
	//members define
	private var btn_chat_current:JButton;
	private var btn_chat_faction:JButton;
	private var btn_chat_team:JButton;
	private var btn_chat_world:JButton;
	
	/**
	 * MyPaneSelectChannel Constructor
	 */
	public function FrameSelectChannel()
	{
		setClosable(false);
		setResizable(false);  
		setBorder(new EmptyBorder());
		this.getTitleBar().setMinimizeHeight(0);
		
		//component creation
		setSize(new IntDimension(43, 84));
		setPreferredSize(new IntDimension(43, 84));
		var layout0:GridLayout = new GridLayout();
		layout0.setRows(4);
		layout0.setColumns(1);
		layout0.setHgap(0);
		layout0.setVgap(0);
		getContentPane().setLayout(layout0);
		
		btn_chat_current = new JButton();
		btn_chat_current.setLocation(new IntPoint(5, 5));
		btn_chat_current.setSize(new IntDimension(43, 21));
		btn_chat_current.setText("label");
		
		btn_chat_world = new JButton();
		btn_chat_world.setLocation(new IntPoint(0, 21));
		btn_chat_world.setSize(new IntDimension(31, 23));
		btn_chat_world.setText("label");
		
		btn_chat_faction = new JButton();
		btn_chat_faction.setLocation(new IntPoint(5, 33));
		btn_chat_faction.setSize(new IntDimension(31, 23));
		btn_chat_faction.setText("label");
		
		btn_chat_team = new JButton();
		btn_chat_team.setLocation(new IntPoint(5, 61));
		btn_chat_team.setSize(new IntDimension(31, 23));
		btn_chat_team.setText("label");
		
		//component layoution
		getContentPane().append(btn_chat_current);
		getContentPane().append(btn_chat_world);
		getContentPane().append(btn_chat_faction);
		getContentPane().append(btn_chat_team);
		
		
		setImages();
		
	}
	
	//_________getters_________
	
	public function setImages():void
	{
		this.setBackgroundDecorator(null);
		btn_chat_current.wrapSimpleButton(Client.getUIElement("btn_chat_current") as SimpleButton);
		btn_chat_current.setText("");
		btn_chat_faction.wrapSimpleButton(Client.getUIElement("btn_chat_faction") as SimpleButton);
		btn_chat_faction.setText("");
		btn_chat_team.wrapSimpleButton(Client.getUIElement("btn_chat_team") as SimpleButton);
		btn_chat_team.setText("");
		btn_chat_world.wrapSimpleButton(Client.getUIElement("btn_chat_world") as SimpleButton);
		btn_chat_world.setText("");
		
		btn_chat_current.addActionListener(onBtnChatCurrent);
		btn_chat_world.addActionListener(onBtnChatWorld);
		btn_chat_faction.addActionListener(onBtnChatFaction);
		btn_chat_team.addActionListener(onBtnChatTeam);
	}
	public function update():void
	{
		btn_chat_faction.setEnabled(FrameFaction.isInFaction());
		btn_chat_team.setEnabled(CharInfo.objSelf.isInTeam());
	}
	protected function onBtnChatCurrent(e:Event):void
	{
		PanelMainHelp.getInstance().updateChannel(1);
		hide();
	}
	protected function onBtnChatWorld(e:Event):void
	{
		PanelMainHelp.getInstance().updateChannel(2);
		hide();
	}
	protected function onBtnChatFaction(e:Event):void
	{
		PanelMainHelp.getInstance().updateChannel(3);
		hide();
	}
	protected function onBtnChatTeam(e:Event):void
	{
		PanelMainHelp.getInstance().updateChannel(4);
		hide();
	}
	public static var _frame:FrameSelectChannel = null;
	public static function show():void
	{
		
		if(isShowing())
		{
			hide()
			return;
		}
		if(_frame == null)
		{
			_frame = new FrameSelectChannel();
			PanelMainHelp.getInstance().addChild(_frame);
		}
		_frame.show();
		_frame.update();
		PanelMainHelp.getInstance().bringToTop(_frame);
		_frame.x = 0;
		_frame.y = 600-_frame.height-30;//(Engine.H - _frame.height) / 2;
		
	}
	public static function hide():void
	{
		if(isShowing())_frame.hide();
	}
	public static function isShowing():Boolean
	{
		return(_frame != null&& _frame.isShowing());
	}
	
	
}
